<!DOCTYPE html>
<html dir="ltr" lang="cn">
<head>
    <meta charset="UTF-8" />
    <title>打印订单标签</title>
    <link href="__PUBLIC__/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
    <script type="text/javascript" src="__PUBLIC__/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <link href="__PUBLIC__/bootstrap/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
    <style media="print" type="text/css">.noprint{display:none}</style>
<script type="text/javascript">
	var jl_buy_list = "众创织梦配送标签";
</script>
</head> 
<body>
<script type="text/javascript" src="/Public/js/kd_LodopFuncs.js?v=22e3135"></script>
<div class="print-main">
    <input type="hidden" name="printer" value="{$order.biaoqian_print}">
    <input type="hidden" name="width" value="{$order.printb_w}">
    <input type="hidden" name="height" value="{$order.printb_h}">
    <link rel="stylesheet" type="text/css" href="/Public/js/kd_LodopFuncs.css">
    <div class="print-warp a4"><b style="color:blue;font-size: 15px;">提示：拆单、合并单后一定要重新填写打印标签！</b>
        <div id="printContent"> 
			<style type="text/css">
			    table{border-collapse: collapse;}
			    td{border-bottom:1px #000 solid}
				.biaoqian{font-size:25px;border-bottom:2px solid #000;margin-top:10px;}
				.print-handle .print-btn{width:120px;}
			</style>
            <div class="print-content" style="width:{$order.printb_w}mm;border: none;">
                <div class="print-panel mb0" style="padding:1mm 3mm 1mm 1mm; width:{$order.printb_w}mm;border:none;">
                    <table style="width:{$order.printb_w}mm;">
                        <tbody>
					<tr style="border-bottom:2px dashed #000;">
					<td style="text-align:left;width:50mm;">
					<img src="" width="150px">
							<div><strong><span style="font-size:16px;">{$order.order_sn}</span></strong></div>
							<div class="biaoqian" ><strong>{$myfenbu_name}：{$order.biaoshi_xian}-

							<if condition="$order.fast_text neq null">

							    {$order.fast_text}
							    <else/>
							    {$order.biaoshi}{$order.fast_text}
							 </if>

							</strong></div>

							<span style="font-size:18px;"><strong>件数</strong>：（）/{$order.jian_count} 件</span>
						</td> 
						<td style="width:45mm;"><img id="erwei" style="float:left;" src="{$pic_data1}" width="80%"></td>
						</tr>
                        <tr>
                            <td colspan="2"><span style="font-size:18px;"><strong style="font-size:22px;font-weight:bold;">客户：{$order.company}</strong></span></td>
                        </tr>
						<tr>
                            <td colspan="2"><div style="font-size:16px;width:100%;"><b>备注：</b><b>{$order.store_name}</b><span style="font-size:16px;">&nbsp;&nbsp;&nbsp;{:date("Y/m/d");}</span></div>
                        </tr>
						<tr>
                            <td colspan="2"><div style="font-size:16px;width:98%;"><span style="font-size:16px;">{$order.user_note|htmlspecialchars_decode}</span></div>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="print-handle">
            <div class="print-btn" style="margin: 30px 3px;"><a href="javascript:void(0);" ectype="btnPreview"><i class="iconfont icon-browse"></i>预览标签</a></div>
            <div class="print-btn" style="margin: 30px 3px;"><a href="javascript:void(0);" ectype="btnPrint"><i class="iconfont icon-dayin"></i>打印标签</a>
            </div>
			<?php
			if($order['dai_type'] == 2)
				echo '<a href="/index.php?m=Seller&c=Order&a=add_order&action=1" target="_blank" style="display: block;width: 120px;float: left;"><i class="iconfont icon-dayin"></i> < 继续添加特殊订单</a>';
			?>
			
			<a href="/Public/js/CLodop_Setup_for_Win32NT.exe" target="_blank" style="display: block;width: 120px;float: right;"><i class="iconfont icon-dayin"></i>下载打印控件</a>
        </div>
    </div>
    <style type="text/css">
        .print-content .print-panel{min-height: 240px}
    </style>
    <input type="hidden" name="order_type" value="order">
    <input type="hidden" name="p_num" value="{$order.jian_count}">
    <script type="text/javascript">
        $(document).on("click", "*[ectype='btnPrint']", function () {
            $(".print_textarea").each(function () {
                $(this).hide();
                $(this).siblings(".print-remark").html($(this).val()).show();
            });
            var printer = $("input[name='printer']").val();
            var width = $("input[name='width']").val();
			var height = $("input[name='height']").val();
            var p_num = $("input[name='p_num']").val();

            if (printer == '' || printer == null) {
                alert(jl_print_no_printer);
                return false;
            } 
            var html = $("#printContent").html();
            var title = jl_buy_list;
             var order_id = '{:I('order_id')}'
            $.ajax({
                type: "POST",
                url: "/Seller/Order/order_biaoqian",//+tab,window.location.reload();
                data: {order_id: order_id},
                success: function (data) {
                  
					 
                },
                error:function(){
                    layer.alert('网络异常', {icon: 2,time: 3000});
                }
            });
            lodop_print_html(title, html, printer, width,height,p_num,{$pic_data});
        });

        $(document).on("click", "*[ectype='btnPreview']", function () {
            
            $(".print_textarea").each(function () {
                $(this).hide();
                $(this).siblings(".print-remark").html($(this).val()).show();
            });
            var printer = $("input[name='printer']").val();
            var width = $("input[name='width']").val();
			var height = $("input[name='height']").val();
            var p_num = $("input[name='p_num']").val();

            if (printer == '' || printer == null) {
                alert(jl_print_no_printer);
                return false;
            }
            var html = $("#printContent").html();
            var title = jl_buy_list;
           
            lodop_preview_html(title, html, printer, width,height,p_num,{$pic_data});
            
        });

        $(".print-remark").click(function () {
            $(this).hide();
            $(this).siblings(".print_textarea").val($(this).html()).show();
        });
    </script>
</body>
</html>